package cliente.domain;


/**
 * Represents a Twitter user.
 *
 * It's basically just a bean that contains information about a user.
 */
public class User {
    private String id;
    private String name;
    private String screenName;
    private String description;
    private String url;
    private boolean protectedProfile;
    private int followers;
    private int following;
    private String createdAt;
    private int tweets;
    private Status lastTweet;

    public User() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getScreenName() {
        return screenName;
    }

    public void setScreenName(String screenName) {
        this.screenName = screenName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isProtectedProfile() {
        return protectedProfile;
    }

    public void setProtectedProfile(boolean protectedProfile) {
        this.protectedProfile = protectedProfile;
    }

    public int getFollowers() {
        return followers;
    }

    public void setFollowers(int followers) {
        this.followers = followers;
    }

    public int getFollowing() {
        return following;
    }

    public void setFollowing(int following) {
        this.following = following;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(String createdAt) {
        this.createdAt = createdAt;
    }

    public int getTweets() {
        return tweets;
    }

    public void setTweets(int tweets) {
        this.tweets = tweets;
    }

    public Status getLastTweet() {
        return lastTweet;
    }

    public void setLastTweet(Status lastTweet) {
        this.lastTweet = lastTweet;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder()
                .append("User{\n")
                .append("  id='").append(id).append("\'\n")
                .append("  name='").append(name).append("\'\n")
                .append("  screenName='").append(screenName).append("\'\n")
                .append("  description='").append(description).append("\'\n")
                .append("  url='").append(url).append("\'\n")
                .append("  protected=").append(protectedProfile).append("\n")
                .append("  followers=").append(followers).append("\n")
                .append("  following=").append(following).append("\n")
                .append("  createdAt='").append(createdAt).append("\'\n")
                .append("  tweets=").append(tweets).append("\n");

        if (lastTweet != null) {
            builder.append("  lastTweet={")
                    .append("id=").append(lastTweet.getId()).append("}\n");
        }
        builder.append('}');

        return builder.toString();
    }
}
